Skip to content

Conversation

@Kaihui-intel
Copy link
Contributor

@Kaihui-intel Kaihui-intel commented Jan 23, 2026

Description

update test_cpu for transformers v5

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please specify):

Related Issues

Fixes or relates to ##1314

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.

Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Copilot AI review requested due to automatic review settings January 23, 2026 07:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CPU unit tests to handle compatibility issues introduced in transformers v5, ensuring tests either skip problematic features or adapt to API changes.

Changes:

  • Added conditional test skipping for transformers v5 due to breaking changes in MOE models, GGUF format support, and API deprecations
  • Updated assertions to accept both float32 and bfloat16 dtypes for model tensors
  • Modified model configuration and dtype handling to work with transformers v5 architecture changes

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/helpers.py Adds transformers_version helper variable for version checking across tests
test/test_cpu/quantization/test_mxfp_nvfp.py Skips MOE model tests for transformers v5 due to breaking changes
test/test_cpu/models/test_moe_model.py Skips Llama4 test and adds commented code for future v5 compatibility
test/test_cpu/integrations/test_llmc_integration.py Skips llmcompressor integration test due to deprecated use_auth_token parameter
test/test_cpu/export/test_gguf_format.py Skips entire GGUF test class for transformers v5 due to loading failures
test/test_cpu/export/test_export.py Updates dtype assertions to accept both float32 and bfloat16
test/test_cpu/core/test_autoround.py Adds version-specific model path assertions for Qwen2VL visual model
test/test_cpu/backends/test_torch_backend.py Changes model dtype from bfloat16 to float32 and moves dtype parameter to tokenizer
auto_round/modelling/llama4.py Conditionally imports no_init_weights from different modules based on transformers version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

sys-lpot-val and others added 2 commits January 22, 2026 23:56
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
@chensuyue chensuyue added this to the 0.10.0 milestone Jan 23, 2026
sys-lpot-val and others added 5 commits January 25, 2026 22:49
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
@Kaihui-intel Kaihui-intel requested a review from n1ck-guo January 26, 2026 07:53
sys-lpot-val and others added 4 commits January 26, 2026 01:33
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Signed-off-by: WeiweiZhang1 <weiwei1.zhang@intel.com>
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
Signed-off-by: sys-lpot-val <sys_lpot_val@intel.com>
@Kaihui-intel
Copy link
Contributor Author

waiting for fix ci by XuehaoSun · Pull Request #1344 · intel/auto-round

  1. revert to torch2.8
2026-01-27T07:41:58.9168661Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/utils/common.py:87: in wrapper
2026-01-27T07:41:58.9168977Z     return func(*args, **kwargs)
2026-01-27T07:41:58.9169223Z            ^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9169510Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py:372: in from_pretrained
2026-01-27T07:41:58.9169938Z     return model_class.from_pretrained(
2026-01-27T07:41:58.9170250Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py:4075: in from_pretrained
2026-01-27T07:41:58.9170547Z     hf_quantizer.preprocess_model(
2026-01-27T07:41:58.9170861Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/quantizers/base.py:167: in preprocess_model
2026-01-27T07:41:58.9171231Z     self._process_model_before_weight_loading(model, **kwargs)
2026-01-27T07:41:58.9171552Z /home/hostuser/.venv/lib/python3.12/site-packages/transformers/quantizers/quantizer_auto_round.py:54: in _process_model_before_weight_loading
2026-01-27T07:41:58.9171949Z     model, used_backends = convert_hf_model(model, target_device)
2026-01-27T07:41:58.9172453Z                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9172778Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/convert_model.py:600: in convert_hf_model
2026-01-27T07:41:58.9173127Z     used_backends = _replace_by_quant_layers(model, layer_configs, backend, target_device, packing_format)
2026-01-27T07:41:58.9173434Z                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9173725Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/convert_model.py:348: in _replace_by_quant_layers
2026-01-27T07:41:58.9174159Z     layer_backend = get_layer_backend(target_device, backend, packing_format, config, in_features, out_features)
2026-01-27T07:41:58.9174459Z                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-01-27T07:41:58.9174736Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/backend.py:1019: in get_layer_backend
2026-01-27T07:41:58.9175049Z     process_requirement(backend_info.requirements, target_device=device)
2026-01-27T07:41:58.9175431Z /home/hostuser/.venv/lib/python3.12/site-packages/auto_round/inference/backend.py:1138: in process_requirement
2026-01-27T07:41:58.9175723Z     exit(-1)
  1. dataset issue
FAILED test_cpu/utils/test_calib_dataset.py::TestLocalCalibDataset::test_combine_dataset
FAILED test_cpu/utils/test_calib_dataset.py::TestLocalCalibDataset::test_combine_dataset2

@Kaihui-intel Kaihui-intel merged commit f6e7e30 into main Jan 28, 2026
28 of 29 checks passed
@Kaihui-intel Kaihui-intel deleted the kaihui/v5_cpu_ut branch January 28, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants